import request from '@/utils/request'

// 查询供应商采购订单列表
export function listSupplizerPsorders(query) {
  return request({
    url: '/supply/psorders/supplizer/list',
    method: 'get',
    params: query
  })
}
//用户查看个人订单
export function listPsorders(query) {
  return request({
    url: '/supply/psorders/list',
    method: 'get',
    params: query
  })
}

// 查询供应商采购订单列表通过客户id
export function listPsordersById(query) {
  return request({
    url: '/supply/psorders/byCustomerId',
    method: 'get',
    params: query
  })
}

// 查询供应商采购订单详细
export function getPsorders(orderId) {
  return request({
    url: '/supply/psorders/' + orderId,
    method: 'get'
  })
}

// 新增供应商采购订单
export function addPsorders(data) {
  return request({
    url: '/supply/psorders',
    method: 'post',
    data: data
  })
}

// 修改供应商采购订单
export function updatePsorders(data) {
  return request({
    url: '/supply/psorders',
    method: 'put',
    data: data
  })
}

// 删除供应商采购订单
export function delPsorders(orderId) {
  return request({
    url: '/supply/psorders/' + orderId,
    method: 'delete'
  })
}

//创建订单
export function createOrder(data) {
  return request({
    url: '/supply/psorders/create',
    method: 'post',
    data: data
  })
}


//创建群订单
export function createOrders(data) {
  return request({
    url: '/supply/psorders/creates',
    method: 'post',
    data: data
  })
}

//创建订单
export function addOrder(data) {
  return request({
    url: '/supply/psorders',
    method: 'post',
    data: data
  })
}

//根据订单id获取订单详情
export function getOrderDetail(orderId) {
  return request({
    url: '/supply/psorders/prodOfOrders/'+orderId,
    method: 'get'
  })
}



